{% extends "base.html" %}
  {% block content %}
        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h2 class="page-header">Jobs Manage</h2>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Jobs Manage
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>Jid</th>
                                            <th>Status</th>
                                            <th>Fun</th>
                                            <th>Arg</th>
                                            <th>Minions:Pid</th>
                                            <th>User</th>
                                            <th>Manage</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {% for jid,info in jids_running.items %}
                                       <tr class="even gradeC">
                                            <td>{{ jid }}</td>
                                            <td style="text-align:center"><div class="btn-success btn-xs" style="width:60px">Running</div></td>
                                            <td>{{ info.Function }}</td>
                                            <td>
                                                {% for arg in info.Arguments %}
                                                 <li style="list-style-type:none">
                                                       {{ arg }}
                                                 </li>
                                                {% endfor %}
                                            </td>
                                            <td>
                                                {% for running in info.Running %}
                                                  {%for minions,pid in running.items %}
                                                     <li style="list-style-type:none">
                                                       {{ minions }} : {{ pid }}
                                                     </li>
                                                  {% endfor %}
                                                {% endfor %}
                                            </td>
                                            <td>{{ info.User }}</td>
                                            <form method="post" action="/jobs/jobs_manage.html">
                                            <td><button type="submit" class="btn btn-danger btn-xs" value="{{ jid }}" name="kill">Kill</button></td>
                                            </form>
                                       </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->                  
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->
    {% endblock %}
